package com.leyou.item.mapper;

import com.leyou.common.mapper.BaseMapper;
import com.leyou.item.entity.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface BrandMapper extends BaseMapper<Brand> {

    int insertCategoryBrand(@Param("brandId") Long id, @Param("cids") List<Long> cids);

    @Select("SELECT b.* FROM tb_brand b INNER JOIN tb_category_brand cb ON b.`id`=cb.`brand_id` WHERE cb.`category_id` = #{cid}")
    List<Brand> queryBrandByCategoryId(@Param("cid") Long cid);
}
